using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using YABlog.DAL;

namespace YABlog.BLL
{
    public class UserActions
    {
        UserDb userDb = new UserDb();

        public UserActions()
        {

        }

        public bool ValidateUser(string name, string password)
        {
            DataTable table = userDb.GetUserDetails(name);

            try
            {
                if (table.Rows[0][1].ToString() == password)
                {
                    return true;
                }
            }
            catch (Exception ex)
            {
                return false;
            }
            return false;
        }

        public bool UpdateUserDetails(string name, string password)
        {
            return userDb.UpdateUserDetails(name, password);
        }
    }
}
